﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Ef
{
    public class EfDbContext : DbContext
    {
        public EfDbContext(DbContextOptionsBuilder<EfDbContext> options) : base(options.Options)
        {
            options.UseSqlServer("server=.;Database=Ef;Trusted_Connection=True;MultipleActiveResultSets=true");
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer("server=.;Database=Ef;Trusted_Connection=True;MultipleActiveResultSets=true");
            base.OnConfiguring(optionsBuilder);
        }

        public DbSet<Student> Students { get; set; }

        public DbSet<Course> Courses { get; set; }

        public DbSet<StudentCourse> StudentCourses { get; set; }
    }
}
